package view;

import javax.swing.JOptionPane;
/**
 * Contains OptionPanes which displays an information or 
 * error message, regarding a change or invalid variable state.
 * @author Christian
 */
public class OptionPanes {
	
private MainFrame frame;

	public OptionPanes(MainFrame frame) 
	{
	this.frame = frame;
	}

	public void passwordTooShort()
	{
		JOptionPane.showMessageDialog(frame, "Password too short. \nMust contain 6 characters", "Too short", JOptionPane.INFORMATION_MESSAGE);
	}
	
	public void passwordDoesntMatch ()
	{
		JOptionPane.showMessageDialog(frame, "Password doesnt match", "Match error", JOptionPane.INFORMATION_MESSAGE);
	}
	public void oldPaswordIsInvalid ()
	{
		JOptionPane.showMessageDialog(frame, "Old password is invalid. \nPlease try again.", "Password error", JOptionPane.INFORMATION_MESSAGE);
	
	}
	public void pleaseEnterAValue()
	{
		JOptionPane.showMessageDialog(frame, "Please enter a value.", "No value entered", JOptionPane.INFORMATION_MESSAGE);

	}
	public void iDOrPasswordIsInvalid ()
	{
		JOptionPane.showMessageDialog(frame, "The ID or password is invalid.\nPlease try again", 
				"Wrong login", JOptionPane.INFORMATION_MESSAGE);
	}
	
	public void incorrectLoginToManyTimes()
	{
		JOptionPane.showMessageDialog(frame, "You have entered incorrect login too many times. Please contact administration", 
				"Wrong login", JOptionPane.INFORMATION_MESSAGE);	
	}
	public void internalError ()
	{
		JOptionPane.showMessageDialog(frame, "Internal error. Check console for details \n", 
				"Internal error", JOptionPane.ERROR_MESSAGE);	
	}
	public void deletionWasSuccessful()
	{
		JOptionPane.showMessageDialog(frame, "Deletion was successful", "Success", JOptionPane.INFORMATION_MESSAGE);

	}
	public void cantDeleteCurrentUser()
	{
		JOptionPane.showMessageDialog(frame, "You can't delete the current user!", "Deletion error", JOptionPane.ERROR_MESSAGE);	
	}
	public void userIsCreated()
	{
		JOptionPane.showMessageDialog(frame, "The user is created", "Success", JOptionPane.INFORMATION_MESSAGE);
	}
	public void userAlreadyExists()
	{
		JOptionPane.showMessageDialog(frame, "The user already exists", "Duplicate error", JOptionPane.ERROR_MESSAGE);
	}
	public void insufficientFunds()
	{
		JOptionPane.showMessageDialog(frame, "Insufficient Carbon Credits. \n Insert CC or choose another account", "insufficient CC", JOptionPane.OK_OPTION);	
	}
	public void passwordSuccessfullyChanged()
	{
		JOptionPane.showMessageDialog(frame, "Password successfully changed", "Success", JOptionPane.INFORMATION_MESSAGE);
	}
	
	public void categoryNameAlreadyExists()
	{
		JOptionPane.showMessageDialog(frame, "The category already exists", "Duplicate error", JOptionPane.ERROR_MESSAGE);
	}
	
	public void onlyContainIntegers()
	{
		JOptionPane.showMessageDialog(frame, "the amount can only contain integers. \nfor seperation use a dot. ", "Number formatting error", JOptionPane.ERROR_MESSAGE);
	}
	
	public void noAccountIsSelected()
	{
		JOptionPane.showMessageDialog(frame, "No account is currently selected. \nPlease select the account you wish to delete", "Null error", JOptionPane.ERROR_MESSAGE);
	}
	
	public void pleaseEnterAnAccountName()
	{
		JOptionPane.showMessageDialog(frame, "The account has to have a name. \nPlease enter a name for the account", "Null error", JOptionPane.ERROR_MESSAGE);
	}
	
	public void accountTooShort()
	{
		JOptionPane.showMessageDialog(frame, "Account name is too short. \nMust contain at least 1 character", "Too short", JOptionPane.INFORMATION_MESSAGE);
	}
	
	public void noRadioButtonIsSelected()
	{
		JOptionPane.showMessageDialog(frame, "No feature is selected. \nPlease select a feature", "No input", JOptionPane.INFORMATION_MESSAGE);
	}
}
